﻿using Common.Property;
using Domain.Sys;
using DTO;
using DTO.DTO.Sys.Module;
using DTO.DTO.Sys.Role;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IServices.Sys
{
    public interface IRoleService
    {
        #region 权限菜单
        Task<Module> GetModuleById(string id);
        Task<Tuple<IEnumerable<Module>, int>> GetModulePageList(ModuleQueryDTO dto);
        Task<Result> SaveModule(ModuleDetailDTO dto, OperatorInfo op);
        Task<bool> DeleteModule(string id, OperatorInfo op);
        Task<bool> DeleteBatchModule(List<string> ids, OperatorInfo op);
        Task<IEnumerable<Module>> GetModuleByParentIdAsync(Module parm);
        List<ModuleFullDTO> GetRecursionModuleList(string parentid, string type, string status, string fullpath);
        #endregion

        #region 角色权限6
        Task<IEnumerable<string>> GetUserModule(string userId);
        bool CheckRoleControllerAction(string userId, string pageUrl);
        Task<bool> UpdateModules(string roleid, List<RoleModule> modules, OperatorInfo op);
        Task<IEnumerable<RoleModule>> GetModuleByRoleId(string roleid);
        #endregion

        #region 用户角色
        Task<bool> UpdateRoles(string userid, List<UserRole> roles, OperatorInfo op);
        Task<IEnumerable<UserRole>> GetRoleByUserId(string userid);
        Task<Role> GetRoleById(string id);
        Task<Tuple<IEnumerable<Role>, int>> GetRolePageList(RoleQueryDTO dto);
        Task<IEnumerable<Role>> GetRoleList(RoleQueryDTO dto);
        Task<Result> SaveRole(RoleDetailDTO dto, OperatorInfo op);
        Task<bool> DeleteRole(string id, OperatorInfo op);
        Task<bool> DeleteBatchRole(List<string> ids, OperatorInfo op);
        #endregion
    }
}
